package com.alibaba.cirtus.ots.application.adapter.ability.model.enums;

/**
 * @description: 调拨单状态
 * @author: yuhw
 * @date: 2021年08月30日 15:16
 **/
public enum AllocateOrderStatus {
    DRAFT(0,"草稿"),
    Shipment_Processing(1,"待发货"),
    Part_Shipped(2,"部分发货"),
    Shipped(3,"已发货"),
//    Receive_Processing(4,"待收货"),
    Part_Received(5,"部分收货"),
    Received(6,"已收货"),
    Cancel(-1,"取消"),
    WAIT_PUSH(11,"待推送");
    private int value;
    private String desc;
    AllocateOrderStatus(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    /**
     * 通过code获取枚举
     *
     * @param code code
     * @return by code
     */
    public static AllocateOrderStatus getByCode(int code) {
        for (AllocateOrderStatus allocateOrderStatus : values()) {
            if (code==allocateOrderStatus.getValue()) {
                return allocateOrderStatus;
            }
        }
        return null;
    }
}
